// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   RoundRobinLoadBalancer.java

package cn.sendsms;

import java.util.List;

// Referenced classes of package cn.sendsms:
//			LoadBalancer, AGateway, Service, OutboundMessage

public final class RoundRobinLoadBalancer extends LoadBalancer
{

	private int currentGateway;

	public RoundRobinLoadBalancer(Service service)
	{
		super(service);
		currentGateway = 0;
	}

	public AGateway balance(OutboundMessage msg, List candidates)
	{
		if (currentGateway >= candidates.size())
			currentGateway = 0;
		return (AGateway)candidates.get(currentGateway++);
	}
}
